package com.gperp.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gperp.common.CustomerResCondition;
import com.gperp.pojo.AsKeywords;
import com.gperp.pojo.Result;
import com.gperp.service.AskeysWordsService;

@RequestMapping("asKeysWords")
@Controller
@CrossOrigin
public class AsKeysWordsController {

	@Autowired
	private AskeysWordsService  askeysWordsService;
	
	//包含分页，模糊查询	
	@RequestMapping(value="querylist",method=RequestMethod.POST)
	@ResponseBody
	public Result query(Integer page,Integer rows,String keywords){
		Result list=askeysWordsService.querylist(page, rows, keywords);
		return list;
		
	}
	
	@RequestMapping(value="queryById",method=RequestMethod.GET)
	@ResponseBody
	public AsKeywords queryByid(Long id){
		AsKeywords askey=askeysWordsService.querybyid(id);
		return askey;
		
	}
	
	@RequestMapping(value="update",method=RequestMethod.POST)
	@ResponseBody
	public int update(AsKeywords asKwywors){
		int al=askeysWordsService.update(asKwywors);
		return al;
		
	}
	
	//添加关键词
	@RequestMapping(value="insertkeyword",method=RequestMethod.POST)
	@ResponseBody
	public int insertkeyword(AsKeywords asKwywors){
		int al=askeysWordsService.insert(asKwywors);
		return al;
		
	}
	
	//添加关键词
	@RequestMapping(value="querykeyword",method=RequestMethod.POST)
	@ResponseBody
	public AsKeywords querykeyword(String keywords){
		
		return askeysWordsService.querykeyword(keywords);
		
	}
	
}
